import time
from timeit import timeit

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Chrome(executable_path='Chromedriver.exe')
# driver.get("http://121.43.169.97:8848/pageB.html")
url = r"C:\Users\Admin\PycharmProjects\UI自动化测试\注册实例.html";
driver.get(url)
# 1). 填写主页面的注册信息
# 用户名
driver.find_element_by_css_selector("#user").send_keys("admin")
# 密码
driver.find_element_by_css_selector("#password").send_keys("123456")
# 电话号码
driver.find_element_by_css_selector("#tel").send_keys("18776895770")
# 电子邮件
driver.find_element_by_css_selector("#email").send_keys("123@qq.com")



# 2). 点击注册页面A连接
driver.find_element_by_partial_link_text("A网页").click()

# 用户名
driver.find_element_by_css_selector("#userA").send_keys("admin")
# 密码
driver.find_element_by_css_selector("#passwordA").send_keys("123456")
# 电话号码
driver.find_element_by_css_selector("#telA").send_keys("18776895770")
# 电子邮件
driver.find_element_by_css_selector("#emailA").send_keys("123@qq.com")


